from sanic import Sanic
import pymysql.cursors
app = Sanic.get_app("myapp")
app.config.DATA_NAT = '10.1.98.250'
app.config.NAME = "myapp"
app.config.STATION = 'donor_check_3705'

class DBConfig():
    db = pymysql.connect(host=app.config.DATA_NAT,
                         user='root',
                         password='doposoft',
                         database='disable_person_check',
                         charset='utf8',
                         cursorclass=pymysql.cursors.DictCursor)

# app.config.DB_NAME = 'appdb'
# app.config['DB_USER'] = 'appuser'
#
# db_settings = {
#     'DB_HOST': 'localhost',
#     'DB_NAME': 'appdb',
#     'DB_USER': 'appuser'
# }
# app.config.update(db_settings)

# #按照惯例，配置中的键名都需要完全大写
# app.config.GOOD = "yay!"
#
# #反向代理配置
# app.config.FORWARDED_SECRET = "super-duper-secret"
# app.config.REAL_IP_HEADER = "CF-Connecting-IP"
# app.config.PROXIES_COUNT = 2
